package com.lx.pc.service.sysarea.impl;

import java.math.BigInteger;
import java.util.List;

import org.springframework.stereotype.Service;

import com.lx.pc.domain.entity.sysarea.SysareaEntity;
import com.lx.pc.domain.vo.sysarea.SysareaVo;
import com.lx.pc.mybatis.repository.sysarea.SysareaRepository;
import com.lx.pc.service.AbstractService;
import com.lx.pc.service.sysarea.ISysareaService;
import com.lx.pc.utils.OmsPage;

@Service("sysareaService")
public class SysareaServiceImpl extends AbstractService<SysareaEntity, SysareaVo, BigInteger, SysareaRepository> implements ISysareaService{

	@Override
	public int findBySysareaCount(SysareaVo sysarea) {

		return repository.findBySysareaCount(sysarea);
	}

	@Override
	public OmsPage<SysareaVo> findBySysarea(SysareaVo sysarea, Integer page, Integer size) {

		OmsPage<SysareaVo> pages = new OmsPage<SysareaVo>();
		pages.setTotal(repository.findBySysareaCount(sysarea));
		List<SysareaEntity> list = repository.findBySysarea(sysarea,page = (page - 1) * size,size);
		pages.setResult(etoV(list));
		return pages;
	}

	@Override
	public List<SysareaVo> findBySysareaList(SysareaVo sysarea) {
		
		return etoV(repository.findBySysareaList(sysarea));
	}

	@Override
	public SysareaVo findBySerchSysarea(SysareaVo sysarea) {

		return etoV(repository.findBySerchSysarea(sysarea));
	}

}
